package ex.com.jm.food.service.impl;

import java.util.List;


import ex.com.jm.food.dao.AdminAttrDao;
import ex.com.jm.food.entity.Attr;
import ex.com.jm.food.entity.SubType;
import ex.com.jm.food.service.AdminAttrService;

public class AdminAttrServiceImpl implements AdminAttrService {

	private AdminAttrDao adminAttrDao;
	public AdminAttrDao getAdminAttrDao() {
		return adminAttrDao;
	}

	public void setAdminAttrDao(AdminAttrDao adminAttrDao) {
		this.adminAttrDao = adminAttrDao;
	}

	@Override
	public List<Attr> getAttrs(int initPage, int pageRow, String name,
			Integer type,Integer subId, String sort, String order) {
		// TODO Auto-generated method stub
		return this.getAdminAttrDao().getAttrs(initPage, pageRow, name, type,subId, sort, order);
	}

	@Override
	public int attrCounts(String name, Integer type,Integer subId) {
		// TODO Auto-generated method stub
		return this.getAdminAttrDao().attrCounts(name, type,subId);
	}

	@Override
	public Object saveAttr(Attr attr) {
		// TODO Auto-generated method stub
		return this.getAdminAttrDao().saveAttr(attr);
	}

	@Override
	public void updateAttr(Attr attr) {
		// TODO Auto-generated method stub
        this.getAdminAttrDao().updateAttr(attr);
	}

	@Override
	public void delAttr(int id) {
		// TODO Auto-generated method stub
        this.getAdminAttrDao().delAttr(id);
	}

	@Override
	public Attr editAttr(int id) {
		// TODO Auto-generated method stub
		return this.getAdminAttrDao().editAttr(id);
	}

	@Override
	public Attr checkName(String attrName) {
		// TODO Auto-generated method stub
		return this.getAdminAttrDao().checkName(attrName);
	}

	@Override
	public List<SubType> getSubTypes() {
		// TODO Auto-generated method stub
		return this.getAdminAttrDao().getSubTypes();
	}

	@Override
	public SubType getSubType(Integer subId) {
		// TODO Auto-generated method stub
		return this.getAdminAttrDao().getSubType(subId);
	}

}
